﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ClientPage.Master" AutoEventWireup="true"
    CodeBehind="GetQQInfo.aspx.cs" Inherits="Aij1.GetQQInfo" %>

<%@ Register Src="UserControls/CtrlSpecialMenu.ascx" TagName="CtrlSpecialMenu" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="chHead" runat="server">
    <script type="text/javascript">
        function editInfo() {
            clearInterval(cntInt);
            $('#divInfo').show();
            $('#txtName').focus();
        }

        var childIndex = 1;
        function addChild(name, gender, birth, oid) {
            var newchild = $("#tbChild_00").clone();
            newchild.id = "tbChild" + childIndex;
            newchild.html(newchild.html().replace(/_00/g, '_' + childIndex));
            newchild.appendTo($("#tdChildren"));
            newchild.show();
//            $("select[@id='pagesize_slt']")[0].selectedIndex = 1
            $("#txtChildName_" + childIndex).val(name);
            $("#txtChildBirth_" + childIndex).val(birth);
            $("#selChildGender_" + childIndex).val(gender);
            $("#hdnChildId_" + childIndex).val(oid);
            childIndex++;
        }

$(window).ready(function(){
<%foreach(var child in CurrentCustomer.Children){ %>
    addChild('<%= child.TrueName %>','<%=child.Gender %>', '<%=child.Birth.ToString("yyyy-MM-dd") %>', '<%=child.Oid %>');
<%} 
if (OP != "editinfo")
      { %>
   cntInt = setInterval("countDown()", 1000);
   <%} %>
   $("#selGender").val('<%=CurrentCustomer.Gender %>');
});

var sec =3;
var cntInt;
function countDown(){
    $("#spCountDown").html(sec);
    if (sec<=0){
        clearInterval(cntInt);
        gotoPrevUrl();
    }
    sec --;
}

function btnSync_Click() {
    location.replace('GetQQInfo.aspx?OP=sync');
}
    </script>
    <style type="text/css">
        .style1 { width: 100%; }
        input, select { height: 18px; }
    </style>
</asp:Content>
<asp:Content ID="CT2" ContentPlaceHolderID="left" runat="server">
    <uc1:CtrlSpecialMenu ID="CSM" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cph" runat="server">
    <p class="alert">
        <img src="<%=CurrentCustomer.FigureUrl %>" />
        <%=CurrentCustomer.SysName %>:
        <%=Tips %></p>
    <p style="margin-top: 1em;">
        <%if (OP != "editinfo")
          { %>
        <span id="spCountDown">3</span>秒后将自动转到登录前的页面，如果浏览器没有自动跳转，您可以单击:<br />
        <%} %>
        &nbsp;<input type="button" onclick="gotoPrevUrl()" class="bigButton" value="← 转到登录前的页面" />&nbsp;
        <input type="button" onclick="editInfo()" class="bigButton" value="修改账号信息↓" />
    </p>
    <div id='divInfo' style='width: 100%; display: <%=ShowInfo? "":"none" %>'>
        <table style="width: 100%">
            <tr>
                <td width="82">
                    您的姓名:
                </td>
                <td>
                    <input id="txtName" size="30" type="text" name="txtName" id="txtName" value="<%=CurrentCustomer.SysName%>" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td width="82">
                    联系方式:
                </td>
                <td>
                    <input id="txtContact" name="txtContact" size="50" type="text" value="<%=CurrentCustomer.Contact%>" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        如果您愿意，可以提供更多信息:
        <input type="button" onclick="$('#tbMoreInfo').show()" value="更详细的信息↓" />
        <table id="tbMoreInfo" style='width: 100%; display: none'>
            <tr>
                <td width="82">
                    称呼:
                </td>
                <td>
                    <select id="selGender" name="selGender">
                        <option value="0"></option>
                        <option value="1">先生</option>
                        <option value="2">女士</option>
                    </select>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    固定电话:
                </td>
                <td>
                    <input id="txtTel" name="txtTel" size="30" type="text" value="<%=CurrentCustomer.Tel%>" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    手机:
                </td>
                <td>
                    <input id="txtMobile" name="txtMobile" size="30" type="text" value="<%=CurrentCustomer.Mobile%>" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Email:
                </td>
                <td>
                    <input id="txtEmail" name="txtEmail" size="30" type="text" value='<%=CurrentCustomer.Email %>' />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    QQ:
                </td>
                <td>
                    <input id="txtQQ" name="txtQQ" size="30" type="text" value='<%=CurrentCustomer.QQ %>' />
                </td>
                <td>
                    根据QQ登录规定，我们不能直接获取您的QQ号码
                </td>
            </tr>
            <tr>
                <td>
                    收货地址:
                </td>
                <td colspan="2">
                    <input id="txtReceiveAddr" name="txtReceiveAddr" size="60" type="text" value="<%=CurrentCustomer.ReceiveAddr %>" />
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap="nowrap">
                    孩子的信息:<br />
                    &nbsp;
                </td>
                <td colspan="2" id="tdChildren" valign="top">
                    请点击
                    <input id="Button2" type="button" value="添加" onclick="addChild('','2','', 0)" />
                    输入您的孩子的信息。如果不止一个孩子可以连续添加。
                    <table class="style1" id="tbChild_00" style="display: none">
                        <tr>
                            <td width="50" align="right">
                                姓名:<input type="hidden" id="hdnChildId_00" name="hdnChildId_00" />
                            </td>
                            <td width="120">
                                <input id="txtChildName_00" name="txtChildName_00" size="16" type="text" />
                            </td>
                            <td width="50">
                                <select id="selChildGender_00" name="selChildGender_00">
                                    <option value="1">男孩</option>
                                    <option value="2">女孩</option>
                                </select>
                            </td>
                            <td width="50" align="right">
                                生日:
                            </td>
                            <td>
                                <input id="txtChildBirth_00" name="txtChildBirth_00" size="12" type="text" maxlength="12" />(格式如:
                                2005-10-22)
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    附加说明:
                </td>
                <td colspan="2">
                    <textarea id="txtComment" cols="60" name="txtComment" rows="4"><%=CurrentCustomer.Comment %></textarea>
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td width="82">
                    &nbsp;
                </td>
                <td>
                    <div style="float: left">
                        <input id="btnSubmit1" type="submit" value="提交修改" /></div>
                </td>
                <td>
                    <%--<div style="float: left">
                        <a href='javascript:btnSync_Click()'>重新从我的QQ信息获取</a></div>--%>
                </td>
            </tr>
        </table>
    </div>
    <p>
        <h4>
            重要说明:</h4>
        我们只从您的QQ登录信息中获取有限的信息，以方便我们更好的为您服务。<br />
        <%=Config.CompanyName %>注重保护用户的隐私, 未经用户本人允许，不会将用户资料透露给任何第三方。详见<a href="Special.aspx?Id=16"
            target="_blank">隐私声明</a>。<br />
    </p>
</asp:Content>
